<?php

namespace App\Models\admin;

use DateTimeInterface;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

/**
 * 优惠码
 * User: zhx
 * Date: 2023/10/31 0031
 * Time: 16:23
 */
class ApplicationCoupon extends Model
{
    use HasFactory;

    protected $table = 'admin_application_coupon';

    public $fillable = ['name', 'price', 'code', 'status'];

    /**
     * 为 array / JSON 序列化准备日期格式
     */
    protected function serializeDate(DateTimeInterface $date): string
    {
        return $date->format('Y-m-d H:i:s');
    }
}
